<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use DB;

class CarController extends Controller
{
    
    public function index()
    {
    	$list = DB::table('car')->get();
    	return view('admin.car.index',['list'=>$list]);
    }
      public function destroy($id)
    {
        // dd($id);
        $m = DB::table('car')->where('carid',$id)->delete();
        if ($m>0) {
            return redirect('/admin/car');
        }else{
            return redirect('/admin/car');
        }
    }
}
